<!-- Load TinyMCE -->
<script type="text/javascript" src="media/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="media/tiny_mce/config.js"></script>
<script type="text/javascript">
	//tiny('detail[th],detail[en]');
	$(function(){
			$("[rel=en]").hide();
			$(".lang a").click(function(){
				$("[rel=" + $(this).attr("href") + "]").show().siblings().hide();
				$(this).addClass('active').siblings().removeClass('active');
				return false;
			})
	})
</script>
<h1><?php echo admin_breadcrumb(get_breadcrumb($category->id,TRUE)) ?></h1>
<form action="contents/admin/contents/save/<?php echo $content->id ?>" method="post" enctype="multipart/form-data" >
	
<table class="form">
	<tr><th></th><td class="lang"><a href="th" class="active flag th">ไทย</a><a href="en" class="flag en">อังกฤษ</a></td></tr>
	<?php if(is_file('uploads/content/thumbnail/'.$content->image)): ?>
	<tr><th></th><td><img class="img" style="width:77px; height:64px;" src="<?php echo (is_file('uploads/content/thumbnail/'.$content->image))? 'uploads/content/thumbnail/'.$content->image : 'media/images/dummy/77x64.gif' ?>"  /></td></tr>
	<?php endif; ?>
	<tr><th>รูปภาพ </th><td><input type="file" name="image" /></td></tr>
	<tr><th>ไฟล์แนบ </th><td><input type="file" name="file" /></td></tr>
	<tr>
		<th>หัวข้อ </th>
		<td>
			<input type="text" name="title[th]" rel="th" value="<?php echo lang_decode($content->title,'th')?>" class="full" />
			<input type="text" name="title[en]" rel="en" value="<?php echo lang_decode($content->title,'en')?>" class="full" />
		</td>
	</tr>
	<tr>
		<th>รายละเอียด </th>
		<td>
			<div rel="th"><textarea name="detail[th]" class="full tinymce"><?php echo lang_decode($content->detail,'th')?></textarea></div>
			<div rel="en"><textarea name="detail[en]" class="full tinymce"><?php echo lang_decode($content->detail,'en')?></textarea></div>
		</td>
	</tr>
	<tr>
		<th></th>
		<td>
			<?php echo form_hidden('category_id',$category->id)?>
			<?php echo form_submit('',lang('btn_submit'),'class="button"')?>
			<?php echo form_button('',lang('btn_back'),'class="button" onclick="window.location = \'contents/admin/contents/index/'.$category->id.'\'"')?>
		</td></tr>
</table>
</form>